package org.zerocouplage.web.component;

import org.zerocouplage.component.impl.component.ZCAbstractComboBox;

public class ZCComboBoxWeb extends ZCAbstractComboBox {

	public Object display() {
		String comboBox = "<select>";
		int listValueSize = getValue().size();
		int tmpCounter = 0;
		while (tmpCounter < listValueSize) {
			if (getValue(tmpCounter).equals(getSelectedName())) {
				comboBox += "<option value=\"" + getSelectedName() + "\" selected=\"selected\">"
						+ getSelectedName() + "</option>";
				tmpCounter++;
			} else {

				comboBox += "<option value=\"" + getValue(tmpCounter) + "\">"
						+ getValue(tmpCounter) + "</option>";
				tmpCounter++;
			}
		}
		comboBox += "</select>";
		return comboBox;
	}

}
